import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({

    state:{
        keepAliveTagsList:[],
        editableTabs: [{
            text: '开始',
            id: '1',
          }],
        curContextTabId:''
    },

    mutations:{//对state进行修改
        saveEditableTabs(state,data){
            state.editableTabs = data
        },
        // 保存右键点击tab的id
        saveCurContextTabId(state, curContextTabId) {
            state.curContextTabId = curContextTabId
        },
        // 保存缓存页面
        SET_KEEP_ALIVE: (state, keepAliveTagsList) => {
            state.keepAliveTagsList = keepAliveTagsList
        },


    },
    getters: {
        editableTabs: state => {
            // console.log(state.editableTabs)
           return state.editableTabs
        },
        tabPanelHeight: state => state.tabPanelHeight,
        windowWidth: state => state.windowWidth,
    },
    actions:{
        
    }
})
export default store;